home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr25 / me310.zip / UE310CMD.ZIP / EMACS.RC < prev    next >
Text File  |  1989-03-19  |  6KB  |  248 lines

  1. ;    EMACS.RC:    Standard micro Startup program
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4. ;            Last Update: 10/20/87
  5.  
  6. set $discmd FALSE
  7. write-message "[Setting up....]"
  8.  
  9. ; If you screen "SNOWS", comment this line
  10.     set $flicker "FALSE"
  11.  
  12. ; To use an IBM-PC EGA card, uncomment the following line
  13. ;    set $sres "EGA"
  14.  
  15. ;    ***** Rebind the Function key group
  16.  
  17. bind-to-key search-forward        FN1
  18. bind-to-key search-reverse        FN2
  19. bind-to-key hunt-forward        FN3
  20. bind-to-key hunt-backward        FN4
  21. bind-to-key execute-macro-1        FN5
  22. bind-to-key execute-macro-2        FN6
  23. bind-to-key next-window            FN7
  24. bind-to-key execute-macro-3        FN8
  25. bind-to-key save-file            FN9
  26. bind-to-key exit-emacs            FN0
  27.  
  28. bind-to-key execute-macro-10        S-FN1
  29. bind-to-key execute-macro-11        S-FN2
  30. bind-to-key execute-macro-12        S-FN3
  31. bind-to-key execute-macro-13        S-FN4
  32. bind-to-key execute-macro-14        S-FN5
  33. bind-to-key execute-macro-15        S-FN6
  34. bind-to-key execute-macro-16        S-FN7
  35. bind-to-key execute-macro-17        S-FN8
  36. bind-to-key execute-macro-18        S-FN9
  37. bind-to-key execute-macro-19        S-FN0
  38.  
  39. ;    Set Default Global modes
  40.  
  41. add-global-mode "blue"
  42. ;bind-to-key next-page FN<
  43. ;bind-to-key previous-page FNC
  44. ;bind-to-key meta-prefix `
  45.  
  46. ;    Toggle function key window display
  47.  
  48. 1    store-macro
  49.     !if %rcfkeys
  50.         !goto rcfoff
  51.     !endif
  52.  
  53. ;    toggle function key window on
  54.     save-window
  55.     1 next-window
  56.     !if &sequal $cbufname "emacs.hlp"
  57.         delete-window
  58.     !endif
  59.     !if ¬ &sequal $cbufname "Function Keys"
  60.         1 split-current-window
  61.         1 select-buffer "Function Keys"
  62.         add-mode "red"
  63.         !force 5 resize-window
  64.         1 goto-line
  65.     !endif
  66.     set %rcfkeys TRUE
  67.     !force restore-window
  68.     !if &sequal $cbufname "Function Keys"
  69.         next-window
  70.     !endif
  71.     write-message "[Function key window ON]"
  72.     !return
  73.  
  74.     ;Toggle the function key window off
  75. *rcfoff
  76.     save-window
  77.     1 next-window
  78.     !if &sequal "Function Keys" $cbufname
  79.         delete-window
  80.     !endif
  81.     !force restore-window
  82.     write-message "[Function key window OFF]"
  83.     set %rcfkeys FALSE
  84. !endm
  85.  
  86. ;    Toggle HELP file onscreen
  87.  
  88. 2 store-macro
  89.     1 next-window
  90.  
  91.     ;Make sure the function key window isn't up!
  92.     !if &sequal $cbufname "Function Keys"
  93.         delete-window
  94.     !endif
  95.     set %rcfkeys FALSE
  96.  
  97.     ;Bring up page 1
  98.     !if ¬ &seq $cbufname "emacs.hlp"
  99.         help
  100.         8 resize-window
  101.         add-mode "red"
  102.         beginning-of-file
  103.         2 forward-character
  104.     !endif
  105.  
  106. *rchelp
  107.  
  108.     write-message "[PgUp/PgDn] Page    [FN6] EXIT     ^G  Exit leaving page on screen"
  109.     update-screen
  110.     set %rctmp >cmd
  111.     !if &seq %rctmp FNZ
  112.         beginning-of-line
  113.         !force search-reverse "=>"
  114.         1 redraw-display
  115.         !goto rchelp
  116.     !endif
  117.     !if &seq %rctmp FNV
  118.         beginning-of-line
  119.         2 forward-character
  120.         !force search-forward "=>"
  121.         1 redraw-display
  122.         !goto rchelp
  123.     !endif
  124.     !if &seq %rctmp FN6
  125.         delete-window
  126.         !if &seq %rcfkeys TRUE
  127.             set %rcfkeys FALSE
  128.             execute-macro-1
  129.         !endif
  130.         write-message "[Help Exited]"
  131.         !return
  132.     !endif
  133.     !if &seq %rctmp ^G
  134.         next-window
  135.         set %rcfkeys FALSE
  136.         write-message "[Help Aborted]"
  137.         !return
  138.     !endif
  139.     !goto rchelp
  140. !endm
  141.  
  142. ;    Load a new page
  143.  
  144. 3    store-macro
  145.     !if &seq &find newpage.cmd ""
  146.         write-message "[Can not find NEWPAGE.CMD]"
  147.         !return
  148.     !endif
  149.     execute-file newpage.cmd
  150. !endm
  151.  
  152. ;procedure to clean out the current page (which is nothing right now)
  153.  
  154. store-procedure    clean
  155.     ; nothing by default
  156. !endm
  157.  
  158. ;    Set up auto CMODE
  159.  
  160. 20    store-macro
  161.     set %rctmp &sin $cfname "."
  162.     !if &equ %rctmp 0
  163.         !return
  164.     !endif
  165.     set %rctmp &mid $cfname &add %rctmp 1 5
  166.     !if &or &seq %rctmp "c" &seq %rctmp "h"
  167.         add-mode "cmode"
  168.     !endif
  169.     !if &seq %rctmp "mss"
  170.         add-mode "wrap"
  171.     !endif
  172. !endm
  173. set $readhook execute-macro-20
  174.  
  175. ;    This function activates the function key window as
  176. ;    a legitimate place to call up function keys
  177.  
  178. 21    store-macro
  179.  
  180.     ;remember where we started, and do the mouse movement
  181.     save-window
  182.     mouse-move-down
  183.  
  184.     ;If not in the function key window... leave
  185.     !if ¬ &sequal $cbufname "Function Keys"
  186.         !return
  187.     !endif
  188.  
  189.     ;Find out what function key were gonna do
  190.     add-mode magic
  191.     2 forward-character
  192.     set %rctmp $search
  193.     !force search-reverse "[fF][0-9]"
  194.     !if &seq $status FALSE
  195.         delete-mode magic
  196.         set $search %rctmp
  197.         !return
  198.     !endif
  199.  
  200.     ;we are on the "f" or "F".  Get the function key type and number now
  201.     set $search %rctmp
  202.     set %fcase lower
  203.     !if &equ $curchar 70
  204.         set %fcase upper
  205.     !endif
  206.     1 forward-character
  207.     set %fnum &chr $curchar
  208.     1 forward-character
  209.     set %fnum &cat %fnum &chr $curchar
  210.     set %fnum &add %fnum 0
  211.     !if &equ %fnum 10
  212.         set %fnum "0"
  213.     !endif
  214.     set %fname &cat "FN" %fnum
  215.     !if &seq %fcase upper
  216.         set %fname &cat "S-" %fname
  217.     !endif
  218.  
  219.     ;save the function
  220.     set %rccmd &bind %fname
  221.     delete-mode MAGIC
  222.  
  223.     ;swallow the up-button
  224.     set %rctmp >c
  225.  
  226.     ;restore the window and exit
  227.     restore-window
  228.  
  229.     ;and then execute it
  230.     execute-named-command &ind %rccmd
  231. !endm    
  232. bind-to-key execute-macro-21 MSa
  233.  
  234. ;    bring up the function key window
  235.  
  236.     1 split-current-window
  237.     select-buffer "Function Keys"
  238.     insert-string "f1 search-> f2 <-search █    MicroEMACS:  Text Editor~n"
  239.     insert-string "f3 hunt->   f4 <-hunt   █ ~n"
  240.     insert-string "f5 fkeys    f6 help     █  Available function key Pages include:~n"
  241.     insert-string "f7 nxt wind f8 pg[    ] █    WORD  BOX  EMACS  PASCAL  C   COBOL~n"
  242.     insert-string "f9 save     f10 exit    █  [use the f8 key to load Pages]~n"
  243.     unmark-buffer
  244.     delete-window
  245.     set %rcfkeys FALSE
  246.     execute-macro-1
  247.     set $discmd TRUE
  248.